1. Field of the Invention
This invention relates to an image forming method and device for forming a synthesized image by synthesizing a main image with a background image.
2. Prior Art
Conventionally, in an image forming device of this kind, a synthesized image is formed by synthesizing main images with background images with preference to the pixels of the main images. In general, main images, background images and synthesized images are represented by image data formed of dot matrices having gradation values representative of gradation levels of pixels of the images assigned to matrix elements thereof, and processed based thereon. For instance, when a main image and a background image are images of characters (letters, numerals, symbols, simple figures, etc.) which can be entered via a keyboard (as text data), main image data representative of the main image and background image data representative of the background image can be formed and stored (registered) by conversion of the text data based on a predetermined font (outline font, bit map font or the like). When the main image and the background image are images which cannot be entered as text data, main image data and background image data representative of the respective images can be also formed and stored (registered) by plotting them as dot images by utilizing e.g. the function of registering nonstandard characters (nonstandard character registration) or the function of registering plotted images (plotted image registration).
Further, in the image forming device of the above-mentioned kind, normally, graduation values representation of graduation levels of pixels of each image can be designated or set before or after the image is formed, and information of the graduation values is stored as image data information. In the case of a monochrome image, graduation values thereof represent gray tones of its pixels . On the other hand, in producing a color image , if colors are designated for portions of the color image, each color is decomposed into graduation values of basic colors, and information of the graduation values is stored as image data information. In this case, when a print image is formed, three primary colors consisting of C (cyan), M (magenta) and Y (yellow) or the three primary colors plus K (black) are employed as the basic colors, whereas when a display image is formed, R (red), G (green) and B (blue) are used as the basic colors.
The above main image and background image are not necessarily formed or stored (registered) as image elements to be formed into a synthesized image from the beginning, that is, such images for synthesis from the beginning. More often, they are formed so as to be separately displayed or printed as individual images. Further, in forming a synthesized image, if image elements (main images and background images) are first formed and stored (registered) with a view to producing a synthesized image, and then an image identical to the synthesized image can be obtained more easily if the image itself is formed from the beginning. Therefore, in general, synthesis of images is carried out, when the images are already stored (registered) and hence the use of these images as main images and background images of a synthesized image saves or reduces the trouble of forming the synthesized image, as compared to the case where a desired image is newly produced.
However, the above-mentioned images formed for being separately displayed or printed as individual images are not formed in anticipation of synthesis, so that a synthesized image formed by using any of them as main and background images can be hard to view or recognize and unattractive due to the unbalanced relationship between the densities and tones of colors of the images depending on a combination thereof.
It is an object of the invention to provide an image forming method and device which is capable of forming a synthesized image with excellent appearance, by synthesizing a main image and a background image having a color suitable for the color of the main image, while using an existing image as the background image.
To attain the above object, according to a first aspect of the invention, there is provided an image forming method of forming a synthesized image by synthesizing a main image and a background mage represented by respective image data items each having n-valued gradation values each having any one of n possible values(n is an integer which is equal to or larger than 3) and defining a density of pixels.
The image forming method according to the first aspect of the invention is characterized by comprising the steps of:
storing a plurality of different data items representative of candidates for the background image, as background image data candidates;
setting an arbitrary one of the background image data candidates to a background image data item representative of the background image;
forming a main image data item representative of the main image, the main image data item having n-valued main image gradation values commonly applied to all valid pixels of the main image, as values of the n-valued gradation values;
forming an adjusted background image data item by modifying the background image data item through replacing background gradation values applied to pixels of the background image as values of the n-valued gradation values by adjusted background gradation values formed by modifying the background gradation values; and
forming a synthesized image data item representative of the synthesized image by synthesizing the main image and the background image based on the adjusted background image data item and the main image data item.
To attain the above, according to a second aspect of the invention, there is provided an image forming device for forming a synthesized image by synthesizing a main image and a background mage represented by respective image data items each having n-valued gradation values each having any one of n possible values(n is an integer which is equal to or larger than 3) and defining a density of pixels.
The image forming device according to the second aspect of the invention is characterized by comprising:
background image data candidate storage means for storing a plurality of different data items representative of candidates for the background image, as background image data candidates;
background image data-setting means for setting an arbitrary one of the background image data candidates to a background image data item representative of the background image;
main image data-forming means for forming a main image data item representative of the main image, the main image data item having n-valued main image gradation values commonly applied to all valid pixels of the main image, as values of the n-value gradation values;
adjusted background image data-forming means for forming an adjusted background image data item by modifying the background image data item through replacing background gradation values applied to pixels of the background image as values of the n-valued gradation values by adjusted background gradation values formed by modifying the background gradation values; and
synthesized image data-forming means for forming a synthesized image data item representative of the synthesized image by synthesizing the main image and the background image based on the adjusted background image data and the main image data item.
According to the image forming method and device, a synthesized image is formed by synthesizing a main image and a background mage represented by respective image data items each having n-valued gradation values each having any one of n possible values(n is an integer which is equal to or larger than 3) and defining a density of pixels. More specifically, a plurality of different data items representative of candidates for the background image are stored as background image data candidates, and an arbitrary one of the background image data candidates is set to a background image data item representative of the background image. There is formed a main image data item representative of the main image, the main image data item having n-valued main image gradation values commonly applied to all valid pixels of the main image, as values of the n-valued gradation values, and an adjusted background image data item is formed by modifying the background image data item through replacing background gradation values applied to pixels of the background image as values of the n-valued gradation values by adjusted background gradation values formed by modifying the background gradation values. A synthesized image data item representative of the synthesized image is formed by synthesizing the main image and the background image based on the adjusted background image data item and the main image data item.
That is, by storing a plurality of different existing images as candidates for the background image, and selecting a desired one of the candidates for use as the background image, it is possible to form a synthesized image in which the main image and the background image are synthesized with each other such that the former is superimposed on the latter. Further, by adjusting the gradation values of the background image, it is possible to form a synthesized image excellent in appearance in which the main image is synthesized with the background image which has a color suitable for the color of the main image. In this case, as the main image data item, there may be used image data having gradation values applied to each pixel as matrix elements of a matrix defining the main image. However, since all valid pixels of the main image data item each have common gradation values (n-valued main image gradation values), the main image data item may be formed to have two-valued (binary) matrix composed of matrix elements each indicative of only the validity/invalidity of each pixel of the main image, and numerical data indicative of gradation values (main image gradation values), to thereby save the capacity of a memory device. Further,when the background image is a single image element having an identical sets of gradation values or can be divided into at least two image elements each having respective identical sets of gradation values, similarly to the main image data item, each data item representative of a corresponding image element of the background image may be formed to have numerical data indicative of a set of gradation values (background gradation values for each image element), and a two-valued (binary) matrix indicative of only the validity/invalidity of each pixel of the image element, to thereby save the capacity of the memory device.
Preferably, the adjustment of the background gradation values is carried out such that the density of the pixels of the background image is decreased.
According to this preferred embodiment of each aspect of the invention, the adjustment of the background gradation values is carried out such that the density of the pixels of the background image is decreased. That is, if a higher density corresponds to larger gradation values, the adjustment is made to decrease the gradation values, whereas if a lower (lighter) density corresponds to larger gradation values, the adjustment is made to increase the gradation values, whereby the background image is made lighter so that the main image becomes denser relatively, which permits emphasis to be put on the main image.
Preferably, the adjustment of the background gradation values is carried out by uniformly multiplying each of the background gradation values corresponding to each pixel by a predetermined factor.
According to this preferred embodiment of each aspect of the invention, the adjustment of the background gradation values is carried out by uniformly multiplying each of the background gradation values corresponding to each pixel by a predetermined factor. That is, only by uniformly multiplying each background gradation value corresponding to each pixel by the predetermined factor, the background gradation values can be adjusted with ease.
Preferably, the background image data candidates include arbitrary data items each representative of an arbitrary dot image formed by inputting data of dots as desired.
According to this preferred embodiment of each aspect of the invention, the background image data candidates include arbitrary data items each representative of an arbitrary dot image formed by inputting data of dots as desired. That is, it is possible to make use of images formed by the user by inputting data of dots as desired. For this entry of data, the functions of non-standard character data registration or depicted image data registration can be made use of.
Preferably, the step of forming the main image data item comprises the steps of inputting text data as a source of the main image, and converting the text data into image data based on predetermined font data to thereby form a main shape image data item representative of a main shape image forming a shape of the main image, by assigning a validity-indicative one of predetermined two values to all pixels of the main shape image as the all valid pixels of the main image, and assigning an invalidity-indicative one of the predetermined two values to the remaining pixels of the main image.
Preferably, the main image data-forming means comprises text data-inputting means for inputting text data as a source of the main image, and main shape image data-forming means for converting the text data into image data based on predetermined font data to thereby form a main shape image data item representative of a main shape image forming a shape of the main image, by assigning a validity-indicative one of predetermined two values to all pixels of the main shape image as the all valid pixels of the main image, and assigning an invalidity-indicative one of the predetermined two values to the remaining pixels of the main image.
According to these preferred embodiments, text data as a source of the main image is input, and then, the text data is converted into image data based on predetermined font data to thereby form a main shape image data item representative of a main shape image forming a shape of the main image by assigning a validity-indicative one of predetermined two values to all pixels of the main shape image as the all valid pixels of the main image, and assigning an invalidity-indicative one of the predetermined two values to the remaining pixels of the main image. That is, text data is input e.g. by keys of a keyboard, and then simply converted into image data based on the predetermined font to thereby form a main shape image data item representative of the shape of the main image with ease.
More preferably, the predetermined font data is outline font data.
The outline font is defined by coordinates of points on a contour line and attributes thereof, and hence the process of forming an image based on the outline font is generally executed by carrying out a contour-plotting process (contour line image-forming process: process of assigning a validity-indicative one (valid value) of the validity-indicative and invalidity-indicative values to matrix elements forming the contour line) and a so-called filling process (process of filling the inside of the contour line: process of assigning the valid value to all the matrix elements inside the contour line). As a result, the main shape image data in which all the matrix elements corresponding to all the pixels inside the contour line of a main image indicate the valid value can be created by a general image-forming method carried out based on the outline font.
Further, as described above, the main image data item can be formed using the two-valued matrix (main shape image data) and numerical value data indicative of the gradation values (main image data gradation values) of the valid pixels, and hence the two-valued matrix (main shape image data) can be easily formed based on the outline font. Therefore, by correlating the main image gradation values to the valid pixels (providing numerical data indicative of the main image gradation values), the main image data item representative of the main image can be easily formed. In short, since the two-valued matrix (main shape image data) indicative of validity/invalidity of each of the pixels of the main image can be easily formed, the main image data item can be easily formed.
Preferably, the image forming method further includes the step of arbitrarily setting the n-valued main image gradation value.
Preferably, the image forming device further includes main image gradation value-setting means for arbitrarily setting the n-valued main image gradation values.
According to these preferred embodiments, the n-valued main image gradation values are arbitrarily set. That is, since it is possible to set the main image gradation values (provide numerical value data indicative of the same) arbitrarily, only by preparing the two-valued matrix (main image shape data) indicative of the validity/invalidity of each of the pixels of the main image, it is possible to form the main image data item representative of the main image with ease. It should be noted that the forming of the two-value matrix (main image shape data) indicative of the validity/invalidity of each of the pixels of the main image alone can be easily carried out e.g. based on the above-mentioned outline font.
Preferably, the main image is a color image, the main image gradation values including primary color gradation values of three primary colors, and setting of the main image gradation values is setting of a color of the main image.
In general, a color or color tone of each pixel of a color image can be expressed by primary color gradation values of the three primary colors as the components of the color. In the preferred embodiment of each aspect of the invention, the main image gradation values include primary color gradation values of the three primary colors, and setting of the main image gradation values is setting of a color of the main image. Hence, the gradation values of the main image can be set with ease by decomposing the set or determined color into the primary color gradation values of the three primary colors, and this makes it possible to easily form the main image data item representative of the main image.
Preferably, the background image is a color image, the background image gradation values including a plurality of basic color gradation values as gradation values of a plurality of basic colors defining a color of the color image, the plurality of basic colors including three primary colors, and the adjustment of the background gradation values being carried out on each of the plurality of basic color gradation values.
According to this preferred embodiment of each aspect of the invention, the background image is a color image, and the gradation values thereof include the plurality of basic color gradation values which define the color of the main image. The basic colors include the three primary colors, and the adjustment of gradation values is made individually on each of the plurality of basic color gradation values. Therefore, even if the background image is a color image, the adjustment of gradation values can be easily carried out to set the same to the adjusted gradation values.
Preferably, the adjustment of the background gradation value is uniformly carried out on the plurality of basic gradation values.
According to this preferred embodiment of each aspect of the invention, the adjustment of the background gradation value is uniformly carried out on the plurality of basic gradation values. That is, even if the background image is a color image, since the adjustment is uniformly made to the plurality of basic color gradation values, the background gradation values can be adjusted further more easily, whereby the resulting values can be set to the adjusted background gradation values.
Preferably, the plurality of basic colors include three primary colors, the three primary colors being cyan, magenta, and yellow.
According to this preferred embodiment of each aspect of the invention, the plurality of basic colors include three primary colors, the three primary colors being cyan, magenta, and yellow. That is, various colors can be expressed by the subtractive color mixing process. Therefore, it is possible to form color print images suitable for expressing colors by reflected light, such as those formed by various XY plotters, printers, and the like.
More preferably, the plurality of basic colors include a basic color corresponding to a mixed color of the three primary colors.
According to this preferred embodiment of each aspect of the invention, the plurality of basic colors include a basic color corresponding to a mixed color of the three primary colors. When color images are printed by using the plurality of basic colors, a mixture of C (cyan), M (magenta), and Y (yellow), for instance, forms K (black). In general, provision of ink of K (black) makes it possible to obtain a more beautiful tone of black color than the use of the K (black) formed by mixing the primary colors. Therefore, since the plurality of basic colors include the basic color corresponding to the mixed color of the three primary colors, beautiful color images can be printed by using the four basic colors. That is, according to this preferred embodiment of each aspect of the invention, since the plurality of basic colors include the basic color corresponding to the mixed color of the three primary colors, more suitable color images can be formed in forming color print images in which colors are expressed using reflected light.
Preferably, the synthesized image is formed as a print image to be printed on a printing object.
According to this preferred embodiment of each aspect of the invention, since the synthesized image is formed as a print image to be printed on a printing object, the invention can be applied to a printing apparatus.
More preferably, the printing object is a tape.
According to this preferred embodiment of each aspect of the invention, since the printing object is a tape, it can be applied to a tape printing apparatus.
More preferably, the print image is printed by an ink jet printing method.
According to this preferred embodiment of each aspect of the invention, since the print image is printed by an ink jet printing method, the invention can be applied to a printing apparatus using the ink jet printing method.
More preferably, the plurality of basic colors include three primary colors, the three primary colors being red, green, and blue.
According to this preferred embodiment of each aspect of the invention, the three primary colors are red, green, and blue. That is, various colors can be expressed by a so-called additive color mixing process, and the image forming process in this case is suitable for a case where illuminants, such as CRTs, liquid crystal displays, and plasma displays, emit light for representation of colors. In addition, in this case, the mixture (mixed color) of colors R, G, and B results in white.
Preferably, the synthesized image is formed as a display image to be displayed on a display screen.
According to this preferred embodiment of each aspect of the invention, since the synthesized image is formed as a display image to be displayed on a display screen, the invention can be applied to a display device.
Preferably, the image forming method further includes the step of determining whether or not the adjustment of the background gradation value should be executed, and the step of forming the synthesized image includes forming the synthesized image data item based on the adjusted background image data item when it is determined that the adjustment of the background gradation values should be executed.
Preferably, the image forming device further includes background gradation value adjustment-determining means for determining whether or not the adjustment of the background gradation value should be executed, and the synthesized image data-forming means forms the synthesized image data item based on the adjusted background image data item when it is determined that the adjustment of the background gradation values should be executed.
According to this preferred embodiment of each aspect of the invention, it is determined whether or not the adjustment of the background gradation values should be executed, and the synthesized image data item is formed based on the adjusted background image data item when it is determined that the adjustment of the background gradation values should be executed. That is, whether the adjustment is executed or not can be selected, and when not selected, the synthesized image can be carried out by another suitable means, or can be stopped. This makes it possible to improve the operability and the capability of the image forming process.
Preferably, the image forming method further includes the step of carrying out dithering based on a dither matrix in which m-valued thresholds (m is an integer which is equal to or larger than 2) each defined by any one of m possible numerical values are arranged as matrix elements for comparison with the n-valued gradation values.
Preferably, the image forming device further includes dithering means for carrying out dithering based on a dither matrix in which m-valued thresholds (m is an integer which is equal to or larger than 2) each defined by any one of m possible numerical values are arranged as matrix elements for comparison with the n-valued gradation values.
According to these preferred embodiments, dithering is carried out based on a dither matrix in which m-valued thresholds (m is an integer which is equal to or larger than 2) each defined by any one of m possible numerical values are arranged as matrix elements for comparison with the n-valued gradation values. Therefore, the present invention can be applied to a display device and a printing apparatus which can only handle gradation images which have a limited number of gradation values smaller in number than the value n.
Preferably, the image forming method includes the step of storing dither masks each represented by each two-valued matrix which is composed of matrix elements each assuming either of two predetermined values and identical in size to the dither matrix, the each two-valued matrix being formed by assigning a validity-indicative one of the predetermined two values to matrix elements thereof corresponding in matrix element location to respective ones of the thresholds of the dither matrix with reference to which each of designated gradation values for being designated for each of the main image gradation values and the adjusted background gradation values satisfies a validity condition, and assigning an invalidity-indicative one of the predetermined two value to remaining matrix elements thereof corresponding in matrix element location to respective ones of the thresholds of the dither matrix with reference to which the corresponding one of the designated gradation values does not satisfy the validity condition, and the step of carrying out the dithering includes the steps of selecting from the dither masks a dither mask corresponding to one of the designated gradation values,which is designated for each matrix portion of the synthesized image data, the each matrix portion having the same size as the dither mask data, and carrying out a logical AND operation between each of matrix elements of the dither mask and a corresponding one of matrix elements of the each matrix portion, on a matrix element-by-matrix element basis, such that the logical AND operation outputs the validity-indicative value only when the each of the matrix elements of the dither mask and the corresponding one of the matrix elements of the each matrix portion both have the validity-indicative value, wherein as a result of the logical AND operation, synthesized dithered image data representative of a synthesized dithered image by a two-valued matrix of the predetermined two values is f formed, the synthesized dithered image being identical in size to the synthesized image.
Preferably, then image forming device includes dither mask storage means for storing dither masks each represented by each two-valued matrix which is composed of matrix elements each assuming either of two predetermined values and identical in size to the dither matrix, the each two-valued matrix being formed by assigning a validity-indicative one of the predetermined two values to matrix elements thereof corresponding in matrix element location to respective ones of the thresholds of the dither matrix with reference to which each of designated gradation values for being designated for each of the main image gradation values and the adjusted background gradation values satisfies a validity condition, and assigning an invalidity-indicative one of the predetermined two value to remaining matrix elements thereof corresponding in matrix element location to respective ones of the thresholds of the dither matrix with reference to which the corresponding one of the designated gradation values does not satisfy the validity condition, and the dithering means includes dithering mask-selecting means for selecting from the dither masks a dither mask corresponding to one of the designated gradation values, which is designated for each matrix portion of the synthesized image data, the each matrix portion having the same size as the dither mask data, and logical AND operation means for carrying out a logical AND operation between each of matrix elements of the dither mask and a corresponding one of matrix elements of the each matrix portion, on a matrix element-by-matrix element basis, such that the logical AND operation outputs the validity-indicative value only when the each of the matrix elements of the dither mask and the corresponding one of the matrix elements of the each matrix portion both have the validity-indicative value, wherein as a result of the logical AND operation, synthesized dithered image data representative of a synthesized dithered image by a two-valued matrix of the predetermined two values is formed, the synthesized dithered image being identical in size to the synthesized image.
According to the preferred embodiment of each aspect of the invention, there are stored dither masks each represented by each two-valued matrix which is composed of matrix elements each assuming either of two predetermined values and identical in size to the dither matrix. Each two-valued matrix is formed by assigning a validity-indicative one of the predetermined two values to matrix elements thereof corresponding in matrix element location to respective ones of the thresholds of the dither matrix with reference to which each of designated gradation values for being designated for each of the main image gradation values and the adjusted background gradation values satisfies a validity condition, and assigning an invalidity-indicative one of the predetermined two value to remaining matrix elements thereof corresponding in matrix element location to respective ones of the thresholds of the dither matrix with reference to which the corresponding one of the designated gradation values does not satisfy the validity condition. From the dither masks, there is selected a dither mask corresponding to one of the designated gradation values, which is designated for each matrix portion of the synthesized image data, the each matrix portion having the same size as the dither mask data, and a logical AND operation is carried out between each of matrix elements of the dither mask and a corresponding one of matrix elements of the each matrix portion, on a matrix element-by-matrix element basis, such that the logical AND operation outputs the validity-indicative value only when the each of the matrix elements of the dither mask and the corresponding one of the matrix elements of the each matrix portion both have the validity-indicative value. As a result of the logical AND operation, synthesized dithered image data representative of a synthesized dithered image by a two-valued matrix of the predetermined two values being formed, the synthesized dithered image is identical in size to the synthesized image.
In general, conventionally, the gradation value of each pixel of each matrix potion having the same size as that of the dither matrix is compared with a corresponding one of the thresholds of the dither matrix, to thereby obtain a pseudo-gradation image. In the image processing method and device, however, to obtain the same effects, it is only required to simply perform a logical AND operation between each of matrix elements of each matrix portion of the main image and a corresponding one of matrix elements of the dither mask, and a logical AND operation between each of matrix element of each matrix portion of the background image and a corresponding one of matrix element of each dither mask corresponding to each adjusted background gradation value. In short, only the logical AND operations are required, so that it is possible to enhance processing speed (shorten processing time) of the apparatus. It should be noted that in this case, dither masks corresponding to respective possible designated gradation values maybe stored in advance, or a dither mask may be newly produced for storage by comparing a designated gradation value with each threshold in a dither matrix, after the designated gradation value is determined. In the former case, it is possible to omit computing time to thereby shorten processing time of the whole image processing operation. In the latter case, the capacity of the memory device for storing dither masks can be saved. In addition, since the above comparing operations are carried out between matrices having the size of the dither matrix, only relatively short processing time is required therefor.
More preferably, the adjustment of the background gradation values is carried out by replacing ones of the dither masks each corresponding to respective ones of the background gradation values by ones of the dither masks corresponding to respective ones of the adjusted background gradation values, for being subjected to the logical AND operation with each matrix portion of the background image.
According to this preferred embodiment of each aspect of the invention, the adjustment of the background gradation values is carried out by replacing ones of the dither masks each corresponding to respective ones of the background gradation values by ones of the dither masks corresponding to respective ones of the adjusted background gradation values, for being subjected to the logical AND operation with each matrix portion of the background image. That is, the mere operation of changing the set dither masks can adjust the background gradation values.
To attain the above object, according to a third aspect of the invention, there is provided an image forming method comprising the steps of storing a plurality of different images as background image candidates;
selecting one of the plurality of background image candidates as a background image; and
forming a synthesized image by synthesizing a main image on the background image after reducing a density of pixels of the background image.
According to this image forming method, a plurality of different images are stored as background image candidates, and one of the plurality of background image candidates is selected as a background image. A synthesized image is formed by synthesizing a main image on the background image after reducing a density of pixels of the background image. Therefore, it is possible to form a synthesized image with excellent appearance, by synthesizing a main image having a color suitable for the color of a background image and the background, while using an existing image as the background image.
The above and other objects, features, and advantages of the invention will become more apparent from the following detailed description taken in conjunction with the accompanying drawings.